package BannerService

import (
	"gorm.io/gorm"
	"h_rpcx/internet/mode/banner"
)

type BannerReq struct {
}
type BannerResp struct {
	Banners []*banner.Banner
}

type BannerService struct {
}

func (b *BannerService) GetAll(req *BannerReq, db *gorm.DB) (BannerResp, error) {
	ba := banner.NewBanner()
	get, err := ba.Get(db)
	if err != nil {
		return BannerResp{}, err
	}
	return BannerResp{Banners: get}, nil
}
